package com.yanjue.common.enums;

/**
 * 图书连载状态枚举
 */
public enum BookSerialStatusEnum {
    SERIAL(1,"连载"),
    SUSPEND(2,"暂更"),
    END(3,"完结");

    private Integer value;
    private String name;

    BookSerialStatusEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public String getName() {
        return name;
    }
    //直接获取对应的状态名
    public static BookSerialStatusEnum fromValue(int value) {
        for (BookSerialStatusEnum status : BookSerialStatusEnum.values()) {
            if (status.getValue() == value) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid serial status value: " + value);
    }

}
